requireJS(['constant', 'site', 'handlebars'], function (Constant, site, Handlebars) {
    //日期控件初始化
    $(".datepicker").datepicker({
        format: 'yyyy-mm-dd',
        autoclose: true,
        pickerPosition: 'bottom',
    })
    var init = function () {
        // site.send({
        //     url: '',//坏账列表
        //     //async:false
        //     callback: function (data) {
        //         var list = JSON.parse(data);
        //  var source = $("#badDebtsDtails_content_tpl").html();
        // var template = Handlebars.compile(source);
        // var html = template(data);
        // $("#badDebtsDtails_content").html(html);

        //     }
        // })

        var content = JSON.parse(localStorage.getItem('content'));

        site.send({
            url: 'manager/selectAdminSalesman.do',//角色列表
            //async:false
            data: {
                pageNum: 1,
                admin_id: content.admin.id
            },
            callback: function (data) {
                var list = JSON.parse(data);

                var source2 = $("#role_list_tpl").html();
                var template2 = Handlebars.compile(source2);
                var html2 = template2(list);
                $("#role_list").html(html2);

            }
        })

        // 部门
        site.send({
            url: "manager/selectDepartmentByLogin.do",
            //async:false
            data: {},
            callback: function (data) {
                var list = JSON.parse(data);
                var source = $("#sousuo_badDebtsDtails_tpl").html();
                var template = Handlebars.compile(source);
                var html = template(list);
                $('#sousuo_badDebtsDtails').html(html);
            }
        })
    }
    init();


})